<template>
	<view>
		<view class="top-box">
			<view style="padding-left: 45rpx;">
				<image style="width: 110rpx;height: 110rpx;" src="https://syxiyi.oss-cn-shenzhen.aliyuncs.com/frontend/img/tips.png"></image>
			</view>
			<view style="color: white;">
				<view style="font-size: 36rpx;font-weight: 600;padding-left: 30rpx;">
					预约已取消
				</view>
				<view style="font-size: 30rpx;padding-left: 30rpx;padding-top: 10rpx;">
					已为您取消本次预约
				</view>
			</view>
		</view>
		<view class="shop-title-box">
			<image style="width: 41rpx;height: 38rpx;margin-left: 30rpx;" src="https://syxiyi.oss-cn-shenzhen.aliyuncs.com/frontend/img/yyshop-logo.png"></image>
			<view style="padding-left: 10rpx;font-weight: 600;color: #323232;font-size: 32rpx;">
				{{detail.name}}
			</view>
		</view>

		<view class="cont-box">
			<view class="cont-list">
				<view>订单详情:</view>
				<view>{{detail.title}}</view>
			</view>
			<view class="cont-list">
				<view>订单编号:</view>
				<view>{{detail.order_no}}</view>
			</view>
			<view class="cont-list">
				<view>下单时间:</view>
				<view>{{detail.create_at}}</view>
			</view>
			<view class="cont-list">
				<view>退款金额:</view>
				<view>￥{{detail.total_price}}</view>
			</view>
			<view class="cont-list">
				<view>退款账户:</view>
				<view v-if="detail.pay_type == 1">微信钱包</view>
				<view v-if="detail.pay_type == 3">余额</view>
				<view v-if="detail.pay_type == 2">会员卡</view>
			</view>
		</view>

		<view class="but">
			<view style="font-size: 30rpx;color: #323232;font-weight: 600;">退款流程</view>
			<view style="padding-top: 30rpx;padding-left: 20rpx;padding-right: 20rpx;">
				<u-time-line >
					<u-time-line-item v-for="(it,i) in list" :key="i">
						<template v-slot:node>
							  <!-- v-if="it.act" -->
							<view class="u-node" style="background: #529FFF;">
								<u-icon name="checkmark-circle-fill" color="#fff" :size="24"></u-icon>
							</view>
						</template>
						<template v-slot:content>
							<!-- <view :class="it.act ? 'actcolor':'noactcolor'"> -->
							<view class="actcolor">
								<view style="font-size: 36rpx;padding-bottom: 10rpx;">{{it.title}}</view>
								<view>{{it.content}}</view>
								<view>{{it.create_at}}</view>
							</view>
						</template>
					</u-time-line-item>

				</u-time-line>
			</view>

		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{
						title: '预约已取消',
						text: '订单已取消，系统审核通过后将为您退款',
						time: '2019-02-16 09:30',
						act: true
					},
					{
						title: '审核已通过',
						text: '为您取消订单并退款',
						time: '2019-02-16 09:30',
						act: true
					},
					{
						title: '退款中',
						text: '您的退款将于1-2个工作日退回您的支付账户',
						time: '2019-02-16 09:30',
						act: false
					},
					{
						title: '退款成功',
						text: '￥99.00已成功退回您的账户',
						time: '2019-02-16 09:30',
						act: false
					}
				],
				order_id: '',
				detail: ''
			}
		},
		onLoad(options) {
			this.order_id = options.id
			this.getDetail()
			this.getLiuCheng()
		},
		methods: {
			getDetail() {
				this.$ajaxRequest.get(this.baseUrl + 'shop/order/Detail', {
					order_id: this.order_id
				}, true).then(res => {
					if (res.data.code == 200) {
						this.detail = res.data.data
					} else {
						uni.showToast({
							title:res.data.msg,
							icon: 'none'
						})
					}
				})
			},
			getLiuCheng() {
				this.$ajaxRequest.get(this.baseUrl + 'shop/order/news', {
					order_id: this.order_id
				}, false).then(res => {
					if (res.data.code == 200) {
						this.list = res.data.data
					} else {
						uni.showToast({
							title:res.data.msg,
							icon: 'none'
						})
					}
				})
			},
		}
	}
</script>

<style>
	.actcolor {
		color: #529FFF;
	}

	.noactcolor {
		color: #A7A7A7;
	}

	.u-node {
		width: 44rpx;
		height: 44rpx;
		border-radius: 100rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.top-box {
		width: 750rpx;
		height: 221rpx;
		background: linear-gradient(-17deg, rgba(255, 114, 59, 1), rgba(255, 160, 68, 1));
		display: flex;
		align-items: center;
	}

	.shop-title-box {
		display: flex;
		align-items: center;
		padding-top: 30rpx;
		padding-bottom: 30rpx;
		border-bottom: 1rpx solid rgba(168, 168, 168, .2);
	}

	.cont-box {
		padding-top: 30rpx;
		padding-bottom: 30rpx;
		border-bottom: 1rpx solid rgba(168, 168, 168, .2);
	}

	.cont-list {
		display: flex;
		/* align-items: center; */
		padding: 10rpx 30rpx 10rpx 30rpx;
		font-size: 30rpx;
		color: #A8A8A8;
	}

	.cont-list>view:last-of-type {
		max-width: 500rpx;
		padding-left: 20rpx;
		color: #323232;
		font-size: 30rpx;
	}

	.but {
		padding: 30rpx;
	}
</style>
